/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.basic.hazard.source.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hopes.bizz.basic.common.constant.enums.ParkBasicSysDictEnum;
import com.hopes.boss.admin.api.resolver.DictResolver;
import com.hopes.boss.admin.api.resolver.enums.AdminDictEnum;
import com.hopes.boss.common.entity.BaseLogicEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 储存场所
 *
 * @author daijie
 * @date 2023-11-01 11:05:35
 */
@Data
@TableName(value = "haz_storage", excludeProperty = "tenantId")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "储存场所")
public class HazStorageEntity extends BaseLogicEntity {

    private static final long serialVersionUID = 1L;


    /**
     * 标识
     */
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "标识")
    private Long id;

    /**
     * 存储点类型
     */
    @Schema(description = "存储点类型")
    private String storageType;

    /**
     * 名称
     */
    @Schema(description = "名称")
    private String hazName;

    /**
     * 编码
     */
    @Schema(description = "编码")
    private String hazCode;

    /**
     * 所属危险源
     */
    @Schema(description = "所属危险源")
    private Long hazardSourceId;

    /**
     * 具体位置
     */
    @Schema(description = "具体位置")
    private String hazLocation;

    /**
     * 投产日期
     */
    @Schema(description = "投产日期")
    private Date useDate;

    /**
     * 设计储量
     */
    @Schema(description = "设计储量")
    private BigDecimal designReserves;

    /**
     * 现存量
     */
    @Schema(description = "现存量")
    private BigDecimal nowReserves;

    /**
     * 贮存面积
     */
    @Schema(description = "贮存面积")
    private BigDecimal hazArea;

    /**
     * 竣工日期
     */
    @Schema(description = "竣工日期")
    private Date completionDate;

    /**
     * 设计使用年限
     */
    @Schema(description = "设计使用年限")
    private Date designUseDate;

    /**
     * 管理员
     */
    @Schema(description = "管理员")
    private String hazManager;

    /**
     * 联系方式
     */
    @Schema(description = "联系方式")
    private String managerTel;

    /**
     * 主要存储介质
     */
    @Schema(description = "主要存储介质")
    private String primaryStorageMedium;

    /**
     * 是否存储剧毒化学品
     */
    @Schema(description = "是否存储剧毒化学品")
    private Boolean toxicChemicalFlag;

    /**
     * 火灾危险性分类
     */
    @Schema(description = "火灾危险性分类")
    private Integer fireType;

    /**
     * 物质状态
     */
    @Schema(description = "物质状态")
    private String metterSate;

    /**
     * 物质类别
     */
    @Schema(description = "物质类别")
    private String metterType;

    /**
     * 备注
     */
    @Schema(description = "备注")
    private String remarks;

    /**
     * 经度
     */
    @Schema(description = "经度")
    private String longitude;

    /**
     * 纬度
     */
    @Schema(description = "纬度")
    private String latitude;

    /**
     * 高度
     */
    @Schema(description = "高度")
    private String altitude;

    /**
     * 定位
     */
    @Schema(description = "定位")
    private String gisLocation;

    /**
     * 范围
     */
    @Schema(description = "范围")
    private String gisScope;

    /**
     * 图片
     */
    @Schema(description = "图片")
    private String img;

    /**
     * 机构ID
     */
    @Schema(description = "机构ID")
    private Long orgId;

    public String getOrgIdStr() {
        return DictResolver.getItemLabelByValue(AdminDictEnum.sys_company, this.orgId);
    }

    public String getStorageTypeStr() {
        return DictResolver.getItemLabelByValue(ParkBasicSysDictEnum.hazard_storage_type, this.storageType);
    }

    public String getMetterSateStr() {
        return DictResolver.getItemLabelByValue(ParkBasicSysDictEnum.hazard_metter_sate, this.metterSate);
    }
}
